Skip to content

Fix: do not need storage management db#8515

Open
fstagni wants to merge 3 commits intoDIRACGrid:integrationfrom
fstagni:fix_doNotNeedStorageManagementDB2
Open

Fix: do not need storage management db#8515
fstagni wants to merge 3 commits intoDIRACGrid:integrationfrom
fstagni:fix_doNotNeedStorageManagementDB2

Conversation

@fstagni
Copy link
Copy Markdown
Contributor

@fstagni fstagni commented Apr 14, 2026

BEGINRELEASENOTES

*WMS
FIX: Do not require StorageManagementDB to be there

ENDRELEASENOTES

@fstagni fstagni requested a review from atsareg as a code owner April 14, 2026 08:01
@fstagni fstagni force-pushed the fix_doNotNeedStorageManagementDB2 branch from 01377d7 to 4c02ebf Compare April 14, 2026 08:02
@aldbr aldbr requested review from chaen and removed request for atsareg April 14, 2026 08:21
@fstagni fstagni force-pushed the fix_doNotNeedStorageManagementDB2 branch from 4c02ebf to 456f456 Compare April 14, 2026 08:47
@fstagni fstagni force-pushed the fix_doNotNeedStorageManagementDB2 branch from 456f456 to c4fa3bd Compare April 14, 2026 09:20
return result
self.storageManagementDB = result["Value"]()
except RuntimeError:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pass and not a warning log?
Based on #8511 (comment)

return result
self.storageManagementDB = result["Value"]()
except RuntimeError:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

return result
self.storageManagementDB = result["Value"]()
except RuntimeError:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

return S_ERROR(f"Can't connect to DB: {excp!r}")
cls.storageManagementDB = result["Value"]()
except RuntimeError:
cls.storageManagementDB = None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here too

)
if not result["OK"]:
return result
storagemanagementdb = result["Value"]()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does happen here if an exception is raised?

mocker.patch("DIRAC.WorkloadManagementSystem.Agent.JobCleaningAgent.JobDB.__init__", side_effect=mockNone)
mocker.patch(
"DIRAC.WorkloadManagementSystem.Agent.JobCleaningAgent.SandboxMetadataDB.__init__", side_effect=mockNone
"DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.ObjectLoader.loadObject",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you patching the right module here? Shouldn't it be JobCleaningAgent?

return {"OK": True, "Value": lambda: mocks[class_name]}

mocker.patch(
"DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.ObjectLoader.loadObject",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here?

@classmethod
def initializeHandler(cls, serviceInfoDict):
"""Initialization of DB objects and OptimizationMind"""
try:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you remove the try/except here? Don't you want to return S_ERROR?


except RuntimeError as excp:
return S_ERROR(f"Can't connect to DB: {excp!r}")
cls.storageManagementDB = result["Value"]()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more parentLogger here. Is that expected?

Suggested change
cls.storageManagementDB = result["Value"]()
cls.storageManagementDB = result["Value"](parentLogger=cls.log)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants